package com.gxa.modules.pc.hospital.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.modules.model.entity.hospital.HospitalPark;
import com.gxa.modules.model.entity.hospital.ParkGuidance;
import com.gxa.modules.pc.hospital.mapper.ParkGuidanceMapper;
import com.gxa.modules.pc.hospital.service.ParkGuidanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 院区导航表 服务实现类
 * </p>
 *
 * @author gxa
 * @since 2022-11-12 05:04:59
 */
@Service
public class ParkGuidanceServiceImpl extends ServiceImpl<ParkGuidanceMapper, ParkGuidance> implements ParkGuidanceService {

    @Autowired
    private ParkGuidanceMapper parkGuidanceMapper;

    /**
     * 根据院区id查询院内导航
     * @param id
     * @return
     */
    @Override
    public List<ParkGuidance> queryByIdToParkGuidance(Integer id) {
        QueryWrapper<ParkGuidance> wrapper = new QueryWrapper<>();
        wrapper.eq("hospital_park_id",id);
        return parkGuidanceMapper.selectList(wrapper);
    }

    @Override
    public void add(ParkGuidance parkGuidance) {
        parkGuidanceMapper.insert(parkGuidance);
    }

    @Override
    public void del(Integer id) {
        parkGuidanceMapper.deleteById(id);
    }
}
